package com.icode.core.model.house;

import com.icode.core.model.AbstractEntity;

import javax.persistence.*;

/**
 * Created with IntelliJ IDEA.
 * User: sunk
 * Date: 15-1-9
 * Time: 下午4:18
 * To change this template use File | Settings | File Templates.
 */
@Entity
@Table(name = "house_week_time")
public class HouseWeekTime extends AbstractEntity {

    private int month;
    private String start;
    private String end;
    @Column(columnDefinition = "bit")
    private boolean status = true;
    @ManyToOne
    @JoinColumn(name = "house_week_id")
    private HouseWeek houseWeek;

    public HouseWeekTime() {
    }

    public HouseWeekTime(int month, String start, String end, boolean status, HouseWeek houseWeek) {
        this.month = month;
        this.start = start;
        this.end = end;
        this.status = status;
        this.houseWeek = houseWeek;
    }

    public HouseWeek houseWeek() {
        return houseWeek;
    }

    public String start() {
        return start;
    }

    public String end() {
        return end;
    }

    public boolean status() {
        return status;
    }

    public void status(boolean status) {
        this.status = status;
    }

    public int month() {
        return month;
    }

    public void updateStartAndEnd(String start, String end,String month) {
        this.start = start;
        this.end = end;
        this.month= Integer.valueOf(month);
    }
}
